package com.qf.limit.controller;


import com.qf.limit.commons.base.BaseController;
import com.qf.limit.commons.r.R;
import com.qf.limit.entity.Friendrequest;
import com.qf.limit.entity.vo.RequestHandlerVo;
import com.qf.limit.service.FriendrequestService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


/**
 * (Friendrequest)表控制层
 *
 * @author makejava
 * @since 2024-09-13 12:48:10
 */
@RestController
@RequestMapping("friendRequest")
@Slf4j
public class FriendrequestController extends BaseController<FriendrequestService> {

    @PostMapping("/insert")
    public R insert(@RequestBody Friendrequest friendrequest) {
        log.debug("发送好友申请......{}", friendrequest);
        getBaserService().save(friendrequest);
        return R.succ();
    }

    @GetMapping("/query4me")
    public R queryMERequest() {

        return R.succ(getBaserService().queryMeRequest());
    }
    @PostMapping("/handler")
    public R requestHandler(@RequestBody @Validated RequestHandlerVo requestHandlerVo) {
        log.debug("处理好友申请....{}", requestHandlerVo);
        return R.succ(getBaserService().requestHandler(requestHandlerVo));
    }
}

